//
//  XUIButton.h
//  Etion
//
//  Created by  user on 11-3-14.
//  Copyright 2011 GuangZhouXuanWu. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "UIButtonExtend.h"

#import "UIViewExtend.h"

@class XUIButton;

@protocol XUIButtonDelegate <NSObject>

@optional

- (BOOL)handleTitleContentRectOfButton:(XUIButton *)btn;

- (BOOL)handleImageContentRectOfButton:(XUIButton *)btn;

- (CGRect)button:(XUIButton *)btn titleContentRect:(CGRect)rect;

- (CGRect)button:(XUIButton *)btn imageContentRect:(CGRect)rect;

- (UIFont *)titleFontInCustomButtonEx:(XUIButton *)btn;

- (void)clickedUpInsideOfButton:(XUIButton *)btn;

@end

typedef NS_ENUM(NSInteger,XUIButtonStyleType)
{
    XUIButtonStyleTypeCustom = UIButtonTypeCustom,
    XUIButtonStyleTypeRoundedRect = UIButtonTypeRoundedRect,
    XUIButtonStyleTypeDetailDisclosure = UIButtonTypeDetailDisclosure,
    XUIButtonStyleTypeInfoLight = UIButtonTypeInfoLight,
    XUIButtonStyleTypeInfoDark = UIButtonTypeInfoDark,
    XUIButtonStyleTypeContactAdd = UIButtonTypeContactAdd,
    XUIButtonStyleTypeLeftHeadImage,
    XUIButtonStyleTypeTopHeadImage,
    XUIButtonStyleTypeCenterImage,
    XUIButtonStyleTypeNONE = 99999,
} ;

@interface XUIButton : UIButton <UIViewExtendDelegate>
{
    XUIButtonStyleType _buttonStyleType;

    __unsafe_unretained id <XUIButtonDelegate> _delegate;
}

@property(nonatomic, assign) XUIButtonStyleType buttonStyleType;

@property(nonatomic, assign) id <XUIButtonDelegate> delegate;

+ (XUIButton *)buttonWithStyleType:(XUIButtonStyleType)buttontype;

+ (XUIButton *)buttonWithStyleType:(XUIButtonStyleType)buttontype delegate:(id <XUIButtonDelegate>)delegate;

@end
